import Vue from 'vue'
import VueI18n from "vue-i18n"
//@ts-ignore
import EN from 'view-design/dist/locale/en-US'
//@ts-ignore
import ZH from 'view-design/dist/locale/zh-CN'
import ViewUI from 'view-design'
//@ts-ignore
import en from './common/lang/en'
//@ts-ignore
import zh from './common/lang/zh'
Vue.use(VueI18n);

// 设置参数，创建 Vuei18n 的实例
const i18n = new VueI18n({
    locale: localStorage.getItem("locale") || "zh", 
    messages:{
      zh: Object.assign(ZH, zh),  //将自己的英文包和iview提供的结合
      en: Object.assign(EN, en)
    }
  });

Vue.use(ViewUI, {
    // @ts-ignore
    i18n: (key, value) => i18n.t(key, value)
})
export default i18n
  